<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Controller;

use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;
use App\Services\JiscarService;

/**
 * @AutoController
 */
class JiscarController extends AbstractController
{
    /**
     * @Inject()
     * @var JiscarService
     */
    protected $jiscarService;

    public function index()
    {
        // $params = $this->validate();

        $data = $this->jiscarService->index();

        return $this->send($data);
    }

    public function get_lottery_record()
    {
        // $params = $this->validate();

        $data = $this->jiscarService->getLotteryRecord();

        return $this->send($data);
    }

    public function lottery()
    {
        // $params = $this->validate();

        $data = $this->jiscarService->lottery();

        return $this->send($data);
    }

    public function voting()
    {
        $params = $this->validate();

        $data = $this->jiscarService->voting($params);

        return $this->send($data);
    }

    public function get_platform()
    {
        // $params = $this->validate();

        $data = $this->jiscarService->getPlatform();

        return $this->send($data);
    }
}
